package com.ocom.accesservice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.accesservice.dao.IDaoCompanyInfo;
import com.ocom.accesservice.service.CompanyInfoService;
import com.ocom.common.entity.company.EntityCompanyInfo;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.mysql.aspect.DataSourceAspect;
import org.springframework.stereotype.Service;


@Service
public class CompanyInfoServiceImpl extends ServiceImpl<IDaoCompanyInfo, EntityCompanyInfo> implements CompanyInfoService {


	@Override
	@DataSourceAspect(type= DataSourceEnum.PART_DB,companyId = "companyId")
	public EntityCompanyInfo getCompanyInfo(Long companyId) {
		/**
		select  comm_type as  commType ,comm_nums as commNums from  company_info
where  com_id=@comId ;
	timesAll=@commType ==1 ? @commNums  ?@commType ==2 ? @commNums * @deviceNums :0;
		 */

		EntityCompanyInfo entityCompanyInfo=this.getById(companyId);
		return entityCompanyInfo;
	}
}
